# -*- mode: snippet -*-
# name: ggplot geom_tufteboxplot
# key: ggplot2.geom_tufteboxplot.template
# key: geom_tufteboxplot.template@ggplot2
# contributor: Shuguang Sun
# --
ggplot(${1:dt}, aes(x = ${2:as.factor(${3:x})}, y = ${4:y})) + # define x and y axis variables
  # with a point for the median and lines for whiskers
  geom_tufteboxplot() +
  # with a line for the interquartile range and points for whiskers
  geom_tufteboxplot(median.type = "line", whisker.type = "point", hoffset = 0) +
  # with a wide line for the interquartile range and lines for whiskers
  geom_tufteboxplot(median.type = "line", hoffset = 0, width = 3) +
  # with an offset line for the interquartile range and lines for whiskers
  geom_tufteboxplot(median.type = "line") +
  # coord_flip() + # Rotate the box plot
  labs(x = "", y = "")
